<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../vue.js"></script>
</head>
<body>
<h2>【例7】filters选项:过滤器-属性绑定使用</h2>
<hr>
<div id="app">
    <div id="dataId">helloworld 1</div>
    <div v-bind:id="dataId ">helloworld 2</div>
    <div v-bind:id="dataId | formatId">helloworld 3</div>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            dataId: 'dff1'
        },
        filters: {
            formatId(value) {
                return value ? value.charAt(1) + value.indexOf('d') : ''
            }
        }
    })
</script>
<hr>
<p><a href="index.html">返回章节目录</a>
    <script>document.write(document.lastModified); </script>
</p>
</body>
</html>
